package com.binguo.api.controller;

import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletResponse;

/**
 * @author yuritian
 * @Title: ZKTecoController
 * @ProjectName binguoDevelop
 * @Description: TODO
 * @date 2019-08-3014:34
 */
@Api(tags = "中控接口")
@RestController
@RequestMapping
public class ZKTecoController {

    @RequestMapping(value = "/iclock/cdata")
    public String cdata(@RequestParam(value = "SN", required = true) String SerialNumber,
                        @RequestParam(value = "pushver", required = true) String pushver,
                        HttpServletResponse response) {
        response.setHeader("registry", "OK");



        return "registry=ok\n" +
                "RegistryCode=${XXX}\n" +
                "ServerVersion=${XXX}\n" +
                "ServerName=${XXX}\n" +
                "PushProtVer=${XXX}\n" +
                "ErrorDelay=${XXX}\n" +
                "RequestDelay=${XXX}\n" +
                "TransTimes=${XXX}\n" +
                "TransInterval=${XXX}\n" +
                "TransTables=${XXX}\n" +
                "Realtime=${XXX}\n" +
                "SessionID=${XXX}\n" +
                "TimeoutSec=${XXX}";
    }


    @RequestMapping(value = "/iclock/exchange")
    public String exchange(@RequestParam(value = "SN", required = true) String SerialNumber,
                           @RequestParam(value = "type", required = true) String type,
                           HttpServletResponse response) {
        if (type.equals("publickey")){

        }else {

        }


        return "OK";
    }


}
